package com.fzfnn.scrapbook.service;

import com.fzfnn.scrapbook.entity.User;
import com.fzfnn.scrapbook.util.R;
import com.fzfnn.scrapbook.vo.UserVo;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Service
public interface UserService {
    /*注册*/
    R register(String email,String password,String code);
    /*获取验证码*/
    R getCode(String email);
    /*登录*/
    R login(String email, String password, HttpServletRequest request);
    /*token信息*/
    R getCurrentUser(String token);
    /*登出账户*/
    R logout(String token);
    /*修改个人信息*/
    R updateUserInfo(String username,String password,String  signature,String token);
    /*修改邮箱地址*/
    R updateEmail(String email,String code,String token);
    /*邮箱验证码登录*/
    R loginByEmail(String email, String code);
    /*忘记密码*/
    R forgetPassword(String email, String code, String newPassword);
    /*查用户*/
    User selectUserByid(Long id);
    /*获取头像*/
    String getImgUrl(Long id);
    /*获取双方信息*/
    List<UserVo> getPrivateChatUsers(String token, Long receiverId);

    R parseToken(String token);

    R personalHomepage(String token, Integer userId);

    void updateUserTags(String token);
}
